# -*- coding: utf-8 -*-

import time
import random
from time import sleep

from project.app import project_app

import logging

from util.warpper import check_func

logger = logging.getLogger(__name__)


@project_app.task(bind=True, )
@check_func
def test_task2(self, ):
    logger.info('task2 start')
    timeout = random.randint(4, 8)
    result = f'task2:timeout:{timeout}'
    logger.info(result)
    time.sleep(timeout)
    logger.info('task2 end')
    return result
